package com.example.mybatisfinaltask.mapper;

import com.example.mybatisfinaltask.pojo.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {
    @Select("select count(*) from emp")
    Integer getCount();
    @Select("select *from emp limit #{begin},#{pageSize}")
    List<Emp> getPageFind(Integer begin,Integer pageSize);
   // @Select("select *from emp")

    List<Emp>selectAll(String name, Short gender, LocalDate begin, LocalDate end);

    void batchDelete(Integer[] ids);

    void add(Emp emp);

    @Select("select *from emp where id=#{id}")
    Emp getById(Integer id);

    void modify(Emp emp);
    @Select("select *from emp where username=#{username} and password=#{password}")
    Emp vertifyLogin(Emp emp);
}
